#coding=utf-8
from validator import *

class Stock(object):
    '''基本股票信息'''
    def __init__(self, code=None):
        
        self.code = code
        self.name = ''
        
        self.market = ''
        self.ipo = '1970-01-01'
        # 发行价
        self.iprice = 0.0
        
class TradableShare(object):
    '''可流通股的数量'''
    def __init__(self, code=None):
        self.code = code
        self.tss = []
        
    def append_ts(self, date, quatity):
        self.tss.append([date, quatity])

class FuQuanRatio(object):
    '''复权因子'''
    def __init__(self, code):
        self.code = code
        self.fqrs = []
    
    def append_fqr(self, dt, ratio):
        self.fqrs.append([dt, ratio])
                                       
class Price(object):
    '''每个交易日的价格'''
    def __init__(self, code=None):
        self.code = code
        
        self.date = '1970-01-01'
        
        self.open = 0.0
        self.close = 0.0
        self.highest = 0.0
        self.lowest = 0.0
        
        self.volume = 0
        self.amount = 0
        
        #复权因子
        self.fuquan_ratio = 0
        
class RTPrice(object):
    '''实时价格(realtime price)'''
    def __init__(self,code=None):
		self.code=code
		
		self.date='1970-01-01'
		self.time='00:00:00'
		
		self.open = 0.0
		self.jump = 0.0
		self.now = 0.0
		self.change = 0.0
		
		self.highest = 0.0
		self.lowest = 0.0
		
		self.volume = 0
		self.amount = 0
	    
		self.bid_buy = 0.0
		self.bid_sell = 0.0
		
		self.slot_buy = []
		self.slot_sell =[]
        
class Deal(object):
    def __init__(self, time, price, volume, bors):
        self.time = time
        self.price = price
        self.volume = volume
        self.bors = bors
        
